<?php
function wpboxes_social_contacts( $contactmethods ) {
	unset($contactmethods['jabber']);
	unset($contactmethods['yim']);
	unset($contactmethods['aim']);
	$contactmethods['websitename'] = 'Website Title';
	$contactmethods['googleplus'] = 'Google+ Profile';
	$contactmethods['linkedin'] = 'LinkedIn Profile';
	$contactmethods['twitter'] = 'Twitter Profile';
	$contactmethods['facebook'] = 'Facebook Profile';
	$contactmethods['pinterest'] = 'Pinterest Profile';
	$contactmethods['youtube'] = 'YouTube Profile';
	$contactmethods['flickr'] = 'Flickr Profile';
	$contactmethods['yahoo'] = 'Yahoo Profile';
	$contactmethods['stumble'] = 'StumbleUpon Profile';
return $contactmethods;
    }

function wpboxes_author_meta(){
	
			
	global $post;
	$email = get_the_author_meta('email');
	$default = get_template_directory_uri().'/images/author/default.png';
	$size = 70;
	$grav_url = "http://www.gravatar.com/avatar/" . md5( strtolower( trim( $email ) ) ) . "?d=" . urlencode( $default ) . "&amp;s=" . $size;
	$authorname = get_the_author();
	$numberofposts = number_format_i18n(get_the_author_posts());
	/* $authorarchive = the_author_posts_link(); */
	$authorpage = get_author_posts_url(get_the_author_meta( 'ID' ));
	$authordesc = get_the_author_meta('description');
	$authortwitter = get_the_author_meta('twitter');
	$authorfacebook = get_the_author_meta('facebook');
	$authorgoogleplus = get_the_author_meta('googleplus');
	$authorlinkedin = get_the_author_meta('linkedin');
	$authorwebsite = get_the_author_meta('url');
	$websitename = get_the_author_meta('websitename');
	$authorfirstname = get_the_author_meta('first_name');
	$authoryoutube = get_the_author_meta('youtube');
	$authorflickr = get_the_author_meta('flickr');
	$authorpinterest = get_the_author_meta('pinterest');
	$authoryahoo = get_the_author_meta('yahoo');
	$authorstumble = get_the_author_meta('stumble');
	
	global $contentbox;
		$contentbox .='<div class="clear"></div><div id="authorboxbody"><div class="authorinfo">';
		$contentbox .='<img class="gravatar" style="float:left" src="'.$grav_url.'" alt="" />';
		$contentbox .='<p class="authorname">Post By <a href="'.$authorpage.'">'.$authorname.'</a> ('.$numberofposts.' Posts)</p>';
		$contentbox .='<p class="description">'.$authordesc.'</p>';
	if (!empty($websitename)) {
		$contentbox .='<p class="website">Website: &rarr; <a href="'.$authorwebsite.'">'.$websitename.'</a></p>'; }
		$contentbox .='</div><div class="authorsocial">';
	if ((!empty($authorfacebook)) || (!empty($authortwitter)) || (!empty($authorgoogleplus)) || (!empty($authorlinkedin)) || (!empty($authorpinterest)) || (!empty($authorflickr)) || (!empty($authoryoutube)) || (!empty($authoryahoo)) || (!empty($authorstumble)))	{
		$contentbox .='<p>Connect</p>'; }
		$contentbox .='<div class="socialicons">';
	
    if (!empty($authorfacebook)) {
        $contentbox .='<a href="'.$authorfacebook.'"><img src="'.get_template_directory_uri().'/images/author/facebook.png" alt="" /></a>'; }
    if (!empty($authortwitter)) {
        $contentbox .='<a href="'.$authortwitter.'"><img src="'.get_template_directory_uri().'/images/author/twitter.png" alt="" /></a>'; }
    if (!empty($authorgoogleplus)) {
        $contentbox .='<a href="'.$authorgoogleplus.'"><img src="'.get_template_directory_uri().'/images/author/googleplus.png" alt="" /></a>'; }
    if (!empty($authorlinkedin)) {
        $contentbox .='<a href="'.$authorlinkedin.'"><img src="'.get_template_directory_uri().'/images/author/linkedin.png" alt="" /></a>'; }
	if (!empty($authorpinterest)) {
        $contentbox .='<a href="'.$authorpinterest.'"><img src="'.get_template_directory_uri().'/images/author/pinterest.png" alt="" /></a>'; }
	if (!empty($authorflickr)) {
        $contentbox .='<a href="'.$authorflickr.'"><img src="'.get_template_directory_uri().'/images/author/flickr.png" alt="" /></a>'; }
	if (!empty($authoryoutube)) {
        $contentbox .='<a href="'.$authoryoutube.'"><img src="'.get_template_directory_uri().'/images/author/youtube.png" alt="" /></a>'; }
	if (!empty($authoryahoo)) {
        $contentbox .='<a href="'.$authoryahoo.'"><img src="'.get_template_directory_uri().'/images/author/yahoo.png" alt="" /></a>'; }
	if (!empty($authorstumble)) {
        $contentbox .='<a href="'.$authorstumble.'"><img src="'.get_template_directory_uri().'/images/author/stumbleupon.png" alt="" /></a>'; }

		$contentbox .='</div></div>';
		$contentbox .='<div class="clear"></div></div>';	

			return $contentbox;
		
			
	
}
remove_filter('pre_user_description', 'wp_filter_kses');
add_filter( 'pre_user_description', 'wp_filter_post_kses' );
add_filter('user_contactmethods','wpboxes_social_contacts',10,1);
?>